/** @method RightValue
 *  @description 右值
 **/
import React from 'react';
import PopTab from '../PopTab';
import LabelInput from '../LabelInput';

import './index.less';

export default function RightValue(props) {
  const callback = data => {
    props.onChange && props.onChange(data);
  };
  const data = props.value.label
    ? { value: props.value.label, label: props.value.value }
    : { value: props.value.value };
  return (
    <PopTab onSetValue={callback} data={props.optionData}>
      <LabelInput {...data} isInput={true} placeholder={props.placeholder} />
    </PopTab>
  );
}
